﻿package mortal.game.view.common.tooltip.tooltips.base
{
    import com.mui.controls.*;
    import flash.text.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;

    public class ToolTipLabel extends ToolTipScaleBg
    {
        protected var _txt:GTextFiled;
        protected var _str:String;

        public function ToolTipLabel()
        {
            this.createChildren();
            return;
        }// end function

        override public function set data(param1) : void
        {
            if (param1)
            {
                this._str = param1;
                this._txt.width = 250;
                this._txt.height = 120;
                this._txt.htmlText = "<TEXTFORMAT LEADING=\'4\'><P ALIGN=\'LEFT\'><FONT FACE=\'微软雅黑,Microsoft YaHei,Microsoft YaHei UI,Microsoft YaHei Light,Mi\' " + "SIZE=\'12\' COLOR=\'#F8E9CC\' LETTERSPACING=\'0\' KERNING=\'0\'>" + this._str + "</FONT></P></TEXTFORMAT>";
                this._txt.width = this._txt.textWidth + 20;
                this._txt.height = this._txt.textHeight + 5;
                _width = this._txt.textWidth + paddingLeft + paddingRight * 2;
                _height = this._txt.textHeight + paddingBottom + paddingTop;
                _scaleBg.setSize(_width, _height);
                return;
            }
            return;
        }// end function

        protected function createChildren() : void
        {
            setBg(ImagesConst.ToolTipBg);
            this._txt = new GTextFiled();
            this._txt.defaultTextFormat = GlobalStyle.textFormatPutong;
            this._txt.autoSize = TextFieldAutoSize.LEFT;
            this._txt.wordWrap = true;
            this._txt.multiline = true;
            this._txt.height = 120;
            contentContainer2D.x = paddingLeft;
            contentContainer2D.y = paddingTop;
            contentContainer2D.addChild(this._txt);
            return;
        }// end function

        public function dispose() : void
        {
            while (this.numChildren)
            {
                
                removeChildAt(0);
            }
            return;
        }// end function

    }
}
